@extends('bootstrap-modal-layout')

@if($script_blade = 'role/create' )@endif

@section('title') 分配权限 @endsection
@section('body')
    <form action="{{ url('admin/role/assign_permission',['id'=>$id]) }}" method="post" class="form-horizontal" id="ajaxForm">
        {!! csrf_field() !!}
        <div class="row">
            @foreach ($permissions->chunk(1) as $chunk)
                <div class="col-md-4">
                    @foreach ($chunk as $permission)
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="permissionIds[]" value="{{ $permission->id }}" @if($role->perms()->where('id',$permission->id)->count() > 0) checked @endif >{{ $permission->display_name }}
                            </label>
                        </div>
                    @endforeach
                </div>
            @endforeach
        </div>
        @include('submit-btn')
    </form>
@endsection
